*/The Influence of Procurator Generals in Constitutional Review:  The Case of Bulgaria
*/Journal of Law and Courts
*/By Tanya Bagashka and Lydia Tiede

*Data file name:
*Variable names and definitions
*newid3= Unique code for every decisional paragraph within a case.  Many cases only have 1 decisional paragraph
*juncon_vote:  Judges vote of unconstitutionality (0=constitutional/1=unconstitutional)
*aligned_judge:  Judges' alignment with government in power at time of the decision (0=not aligned/1=alignedr5NEW)
*jfemale:  Judge is a female (0=male/1=female)
*tenure:  Number of years judge was on the Court at the time of the decision
*jpolitical_backante:  Judge's political background prior to service on the Court (0=no prior political background/1=prior political background)
*PGtenure:  Number of years the Procurador General is on the Court at the time of the decision
*PGrefer:  PG referred case to the Court for review (0=PG did not refer case/1=PG did refer case)
*PGip_unc:  PG appeared on the case as an interested party opining the case was unconstitutinal (0: PG did not opine as an interested party or opined as an interested party, constitutional/1: *PG opined unconstitutinal as an interested party)
*peripunc_WoPG2:  Percent of interested parties appearing on a case (but PG as interested party is ommitted from calculation)
*govgoalper:  percent of seats of the parliament belonging to the governing coalition
*complex_case:  Case involved complex matters
*alignedCourt_per:  Percent of the judges on the Court aligned with the government at the time ofthe decision
*SOP:  Case involved a sepration of powers issue (0=case did not involve separation of powers/1=case did involve separation of powers)
*PGall_dec:  All possible decisions of the PG (0=PG does not appear on the case in any form/1=PG as an interested party opines constitutional/2=PG as an interested party opines        unconstitutional/3=PG refers the case to the Court)

*Code for *Table 1* in the Main Text. 

*Table 1 main text
*Equation 1, column 1a and 1b
biprobit (juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer PGip_unc peripunc_WoPG2 ) ///
(PGip_unc  PGtenure peripunc_WoPG2 alignedCourt_per govcoalper complex_case SOP ) , cluster(newid3) nolog
estat ic

*Equation 2, column 2a and 2b
biprobit (juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer PGip_unc peripunc_WoPG2 govcoalper complex_case SOP)(PGip_unc  PGtenure peripunc_WoPG2 alignedCourt_per govcoalper complex_case SOP ) , cluster(newid3) 
estat ic

*Equation 3, column 3a and 3b
biprobit (juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer PGip_unc peripunc_WoPG2 govcoalper complex_case SOP alignedCourt_per)(PGip_unc  PGtenure peripunc_WoPG2 alignedCourt_per govcoalper complex_case SOP ) , cluster(newid3) 
estat ic



**/Code for Supplemental Materials (SM)
*Table SM 4.1*.  Single equation probit model with case level random effects
*Equation 1, column 1
xtset newid3
xtprobit juncon_vote aligned_judge jfemale tenure jpolitical_backante  PGtenure   PGrefer  PGip_unc peripunc_WoPG2 , i(newid3) nolog
estat ic
margins, dydx(aligned_judge)
margins, dydx(jfemale)
margins, dydx(jpolitical_backante)
margins, dydx( PGrefer)
margins, dydx(PGip_unc)
margins, at (peripunc_WoPG2= (0(.10) 1))
margins, at(tenure =(0(1)10))
margins, at(PGtenure=(0(1)7))

*Equation 2, column 2
xtset newid3
xtprobit juncon_vote aligned_judge jfemale tenure jpolitical_backante  PGtenure   PGrefer  PGip_unc peripunc_WoPG2 govcoalper complex_case SOP, i(newid3) nolog
estat ic
*/rerun margins commands above for marginal effects discussed in paper and additionally, the following commands:
margins, at(govcoalper=(.483(.10).7208))
margins, dydx(complex_case)
margins, dydx(SOP)


*Equation 3, column 3
xtprobit juncon_vote aligned_judge jfemale tenure jpolitical_backante  PGtenure   PGrefer  PGip_unc peripunc_WoPG2 govcoalper complex_case SOP  alignedCourt_per if e(sample)==1, i(newid3) nolog
estat ic
*/rerun margins commands above for equations 1 and 2 and additionally, the following commands:
margins, at(alignedCourt_per=(0(.1) .80))


*Code for Supplemental Materials, *Table SM 4.2.*  Single equation probit model with standard errors clustered
*Equation 1, column 1
probit juncon_vote aligned_judge jfemale tenure jpolitical_backante  PGtenure   PGrefer  PGip_unc peripunc_WoPG2 SOP, cluster(newid3) 
estat ic
*Equation 2, column 2
probit juncon_vote aligned_judge jfemale tenure jpolitical_backante  PGtenure   PGrefer  PGip_unc peripunc_WoPG2 govcoalper complex_case SOP, cluster(newid3) 
estat ic
*Equation 3, column 3
probit juncon_vote aligned_judge jfemale tenure jpolitical_backante  PGtenure   PGrefer  PGip_unc peripunc_WoPG2 govcoalper complex_case SOP  alignedCourt_per, cluster(newid3) 
estat ic


**/Code for Supplemental Materials, *Table SM 5.1.*  Probit models with fixed effects for judges and an alternative measure for the PG's various decisions

*Equation 1, column 1
probit juncon_vote    PGtenure  PGrefer  PGip_unc peripunc_WoPG2 i.yeardec i.judgEnc 
estat ic
*Equation 2, column 2
probit juncon_vote    PGtenure   PGrefer  PGip_unc peripunc_WoPG2 govcoalper	complex_case SOP i.yeardec i.judgEnc 
estat ic
*Equation 3, column 3
probit juncon_vote   PGtenure   PGrefer  PGip_unc peripunc_WoPG2 govcoalper complex_case SOP  alignedCourt_per i.yeardec i.judgEnc 
estat ic
*Equation 4, column 4
probit juncon_vote    PGtenure  i.PGall_dec  peripunc_WoPG2 i.yeardec i.judgEnc 
estat ic
*Equation 5, column 5
probit juncon_vote    PGtenure  i.PGall_dec  peripunc_WoPG2 govcoalper	complex_case SOP i.yeardec i.judgEnc 
estat ic
*Equation 6, column 6
probit juncon_vote   PGtenure  i.PGall_dec  peripunc_WoPG2 govcoalper complex_case SOP  alignedCourt_per i.yeardec i.judgEnc 
estat ic



**/Code for Supplemental Materials, *Table SM 5.2.*  Non-recursive biprobit results
*Equation 1, column 1a & 1b
biprobit (juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer  peripunc_WoPG2 ) ///
(PGip_unc  PGtenure peripunc_WoPG2 alignedCourt_per govcoalper complex_case SOP ) , cluster(newid3) nolog
estat ic


*Equation 2, column 2a & 2b
biprobit (juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer  peripunc_WoPG2 govcoalper complex_case SOP)(PGip_unc  PGtenure peripunc_WoPG2 alignedCourt_per govcoalper complex_case SOP ), cluster(newid3) 
estat ic

*Equation 3, column 3a & 3b
biprobit (juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer peripunc_WoPG2 govcoalper complex_case SOP alignedCourt_per)(PGip_unc  PGtenure peripunc_WoPG2 alignedCourt_per govcoalper complex_case SOP ) , cluster(newid3) 
estat ic


**/Code for Supplemental Materials, *Table SM 5.3.*  Extended regression model(ERM) results
**Equation 1, column 1a & 1b
eprobit juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer  peripunc_WoPG2   , ///
	endogenous(PGip_unc = PGtenure peripunc_WoPG2 govcoalper complex_case SOP alignedCourt_per, probit ) ///
	vce(cluster newid3)
estat ic


**Equation 2, column 2a & 2b
eprobit juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer peripunc_WoPG2 govcoalper complex_case SOP    , ///
	endogenous(PGip_unc = PGtenure peripunc_WoPG2  govcoalper complex_case SOP alignedCourt_per, probit) ///
	vce(cluster newid3)
estat ic

**Equation 3, column 3a & 3b
eprobit juncon_vote aligned_judge jfemale tenure jpolitical_backante PGtenure  PGrefer  peripunc_WoPG2 govcoalper complex_case SOP alignedCourt_per    , ///
	endogenous (PGip_unc =  PGtenure peripunc_WoPG2 govcoalper complex_case SOP alignedCourt_per , probit ) ///
	vce(cluster newid3)
estat ic

